#ifndef REGIONEDITDLG_H
#define REGIONEDITDLG_H

//(*Headers(RegionEditDlg)
#include <wx/dialog.h>
class wxTextCtrl;
class wxComboBox;
class wxStaticText;
class wxBoxSizer;
class wxButton;
//*)

class RegionListCtrl;

class RegionEditDlg: public wxDialog
{
	public:

		RegionEditDlg(RegionListCtrl* parent=0,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
		virtual ~RegionEditDlg();

    public:
        int InitEditDlg(long indexId);

        int InitCreateDlg();

        void SetCountryEditable(bool isEditable);

        void SetProvinceEditable(bool isEditable);

        void SetCityEditable(bool isEditable);

        void ClearCountry(bool skipCode=false);

        void ClearProvince(bool skipCode=false);

        void ClearCity();

        bool InputLegal();

		//(*Declarations(RegionEditDlg)
		wxStaticText* StaticText10;
		wxStaticText* StaticText9;
		wxTextCtrl* m_englishCity;
		wxComboBox* m_cityCode;
		wxTextCtrl* m_simpleChineseCountry;
		wxTextCtrl* m_englishProvince;
		wxStaticText* StaticText2;
		wxStaticText* StaticText6;
		wxButton* m_saveBtn;
		wxComboBox* m_countryCode;
		wxStaticText* StaticText8;
		wxStaticText* StaticText11;
		wxStaticText* StaticText1;
		wxComboBox* m_provinceCode;
		wxStaticText* StaticText3;
		wxStaticText* StaticText5;
		wxStaticText* StaticText7;
		wxTextCtrl* m_englishCountry;
		wxStaticText* StaticText12;
		wxTextCtrl* m_traditionalChineseCountry;
		wxTextCtrl* m_traditionalChineseProvince;
		wxTextCtrl* m_simpleChineseProvince;
		wxStaticText* StaticText4;
		wxTextCtrl* m_traditionalChineseCity;
		wxTextCtrl* m_simpleChineseCity;
		//*)

	protected:

		//(*Identifiers(RegionEditDlg)
		static const long ID_STATICTEXT1;
		static const long ID_COMBOBOX3;
		static const long ID_STATICTEXT11;
		static const long ID_COMBOBOX2;
		static const long ID_STATICTEXT12;
		static const long ID_COMBOBOX1;
		static const long ID_BUTTON1;
		static const long ID_STATICTEXT2;
		static const long ID_STATICTEXT4;
		static const long ID_STATICTEXT5;
		static const long ID_STATICTEXT3;
		static const long ID_STATICTEXT7;
		static const long ID_STATICTEXT6;
		static const long ID_STATICTEXT8;
		static const long ID_STATICTEXT9;
		static const long ID_STATICTEXT10;
		static const long ID_TEXTCTRL1;
		static const long ID_TEXTCTRL2;
		static const long ID_TEXTCTRL3;
		static const long ID_TEXTCTRL4;
		static const long ID_TEXTCTRL5;
		static const long ID_TEXTCTRL6;
		static const long ID_TEXTCTRL7;
		static const long ID_TEXTCTRL8;
		static const long ID_TEXTCTRL9;
		//*)

	private:

        RegionListCtrl* m_parent;

        long m_listIndex;

        bool m_isEditDlg = true;

    private:

		//(*Handlers(RegionEditDlg)
		void OnSaveBtnClick(wxCommandEvent& event);
		void OnCountryCodeSelected(wxCommandEvent& event);
		void OnProvinceCodeSelected(wxCommandEvent& event);
		//*)

		void SaveEdit();

		void SaveCreate();

		DECLARE_EVENT_TABLE()
};

#endif
